import { request} from '@/utils/request.util';
import type { Response, Res } from '@/types/common';

import type {PurchaseInfo,PurchasePagination,PurchaseResponse,PurchaseAddResponse,OrderLog,OrderLogResponse} from '@/types/purchase'
//查询采购单列表
export const getOrderPurchaseList =  (body:PurchasePagination) => request.get<PurchaseResponse> ("/stock/order/getOrderPurchaseList",{
  params: body
});  
// 查询采购单详情
export const getOrderPurchaseDetail = (orderId:string) => request.get<PurchaseAddResponse>("/stock/order/getOrderPurchaseDetail?orderId="+orderId,{});
// 添加采购单
export const addPurchase = (body: PurchaseInfo) => request.post<Response<Res>>("/stock/order/addPurchase",body);
// 审核采购单
export const reviewPurchase = (body: PurchaseInfo) => request.post<Response<Res>>("/stock/order/reviewPurchase",body);
// 结算采购单
export const settlePurchase = (body: PurchaseInfo) => request.post<Response<Res>>("/stock/order/settlePurchase",body);
// 退款采购单
export const refusePurchase = (body: PurchaseInfo) => request.post<Response<Res>>("/stock/order/refusePurchase",body);


//仓库变动流水
export const getOrderLogList =  (body:OrderLog) => request.get<OrderLogResponse> ("/stock/order/getOrderLogList",{
  params: body
});  

 
